Integrand size = 27, antiderivative size = 270 \[ \int (f+g x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2 \, dx=-\frac {B (b c-a d) g (a+b x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{b^2 d}+\frac {B (b c-a d) (2 b d f-b c g-a d g) \log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{b^2 d^2}-\frac {(b f-a g)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2}{2 b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2}{2 g}+\frac {B^2 (b c-a d)^2 g \log (c+d x)}{b^2 d^2}+\frac {B^2 (b c-a d) (2 b d f-b c g-a d g) \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{b (c+d x)}\right )}{b^2 d^2} \]
[Out]
Time = 0.33 (sec) , antiderivative size = 270, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.296, Rules used = {2554, 2398, 2404, 2338, 2351, 31, 2354, 2438} \[ \int (f+g x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2 \, dx=\frac {B (b c-a d) (-a d g-b c g+2 b d f) \log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (B \log \left (\frac {e (a+b x)}{c+d x}\right )+A\right )}{b^2 d^2}-\frac {(b f-a g)^2 \left (B \log \left (\frac {e (a+b x)}{c+d x}\right )+A\right )^2}{2 b^2 g}-\frac {B g (a+b x) (b c-a d) \left (B \log \left (\frac {e (a+b x)}{c+d x}\right )+A\right )}{b^2 d}+\frac {(f+g x)^2 \left (B \log \left (\frac {e (a+b x)}{c+d x}\right )+A\right )^2}{2 g}+\frac {B^2 (b c-a d) (-a d g-b c g+2 b d f) \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{b (c+d x)}\right )}{b^2 d^2}+\frac {B^2 g (b c-a d)^2 \log (c+d x)}{b^2 d^2} \]
[In]
[Out]
Rule 31
Rule 2338
Rule 2351
Rule 2354
Rule 2398
Rule 2404
Rule 2438
Rule 2554
Rubi steps \begin{align*} \text {integral}& = (b c-a d) \text {Subst}\left (\int \frac {(b f-a g-(d f-c g) x) (A+B \log (e x))^2}{(b-d x)^3} \, dx,x,\frac {a+b x}{c+d x}\right ) \\ & = \frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2}{2 g}-\frac {B \text {Subst}\left (\int \frac {(b f-a g+(-d f+c g) x)^2 (A+B \log (e x))}{x (b-d x)^2} \, dx,x,\frac {a+b x}{c+d x}\right )}{g} \\ & = \frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2}{2 g}-\frac {B \text {Subst}\left (\int \left (\frac {(b f-a g)^2 (A+B \log (e x))}{b^2 x}+\frac {(b c-a d)^2 g^2 (A+B \log (e x))}{b d (b-d x)^2}+\frac {(b c-a d) g (2 b d f-b c g-a d g) (A+B \log (e x))}{b^2 d (b-d x)}\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{g} \\ & = \frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2}{2 g}-\frac {\left (B (b c-a d)^2 g\right ) \text {Subst}\left (\int \frac {A+B \log (e x)}{(b-d x)^2} \, dx,x,\frac {a+b x}{c+d x}\right )}{b d}-\frac {\left (B (b f-a g)^2\right ) \text {Subst}\left (\int \frac {A+B \log (e x)}{x} \, dx,x,\frac {a+b x}{c+d x}\right )}{b^2 g}-\frac {(B (b c-a d) (2 b d f-b c g-a d g)) \text {Subst}\left (\int \frac {A+B \log (e x)}{b-d x} \, dx,x,\frac {a+b x}{c+d x}\right )}{b^2 d} \\ & = -\frac {B (b c-a d) g (a+b x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{b^2 d}+\frac {B (b c-a d) (2 b d f-b c g-a d g) \log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{b^2 d^2}-\frac {(b f-a g)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2}{2 b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2}{2 g}+\frac {\left (B^2 (b c-a d)^2 g\right ) \text {Subst}\left (\int \frac {1}{b-d x} \, dx,x,\frac {a+b x}{c+d x}\right )}{b^2 d}-\frac {\left (B^2 (b c-a d) (2 b d f-b c g-a d g)\right ) \text {Subst}\left (\int \frac {\log \left (1-\frac {d x}{b}\right )}{x} \, dx,x,\frac {a+b x}{c+d x}\right )}{b^2 d^2} \\ & = -\frac {B (b c-a d) g (a+b x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{b^2 d}+\frac {B (b c-a d) (2 b d f-b c g-a d g) \log \left (\frac {b c-a d}{b (c+d x)}\right ) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )}{b^2 d^2}-\frac {(b f-a g)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2}{2 b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2}{2 g}+\frac {B^2 (b c-a d)^2 g \log (c+d x)}{b^2 d^2}+\frac {B^2 (b c-a d) (2 b d f-b c g-a d g) \text {Li}_2\left (\frac {d (a+b x)}{b (c+d x)}\right )}{b^2 d^2} \\ \end{align*}
Time = 0.19 (sec) , antiderivative size = 346, normalized size of antiderivative = 1.28 \[ \int (f+g x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2 \, dx=\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2-\frac {B \left (2 A b d (b c-a d) g^2 x+2 B d (b c-a d) g^2 (a+b x) \log \left (\frac {e (a+b x)}{c+d x}\right )+2 d^2 (b f-a g)^2 \log (a+b x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )-2 B (b c-a d)^2 g^2 \log (c+d x)-2 b^2 (d f-c g)^2 \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right ) \log (c+d x)-B d^2 (b f-a g)^2 \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{-b c+a d}\right )\right )+b^2 B (d f-c g)^2 \left (\left (2 \log \left (\frac {d (a+b x)}{-b c+a d}\right )-\log (c+d x)\right ) \log (c+d x)+2 \operatorname {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )\right )\right )}{b^2 d^2}}{2 g} \]
[In]
[Out]
\[\int \left (g x +f \right ) \left (A +B \ln \left (\frac {e \left (b x +a \right )}{d x +c}\right )\right )^{2}d x\]
[In]
[Out]
\[ \int (f+g x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2 \, dx=\int { {\left (g x + f\right )} {\left (B \log \left (\frac {{\left (b x + a\right )} e}{d x + c}\right ) + A\right )}^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int (f+g x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2 \, dx=\text {Timed out} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 673 vs. \(2 (265) = 530\).
Time = 0.27 (sec) , antiderivative size = 673, normalized size of antiderivative = 2.49 \[ \int (f+g x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2 \, dx=\frac {1}{2} \, A^{2} g x^{2} + 2 \, {\left (x \log \left (\frac {b e x}{d x + c} + \frac {a e}{d x + c}\right ) + \frac {a \log \left (b x + a\right )}{b} - \frac {c \log \left (d x + c\right )}{d}\right )} A B f + {\left (x^{2} \log \left (\frac {b e x}{d x + c} + \frac {a e}{d x + c}\right ) - \frac {a^{2} \log \left (b x + a\right )}{b^{2}} + \frac {c^{2} \log \left (d x + c\right )}{d^{2}} - \frac {{\left (b c - a d\right )} x}{b d}\right )} A B g + A^{2} f x - \frac {{\left (a c d g + {\left (2 \, c d f \log \left (e\right ) - {\left (g \log \left (e\right ) + g\right )} c^{2}\right )} b\right )} B^{2} \log \left (d x + c\right )}{b d^{2}} + \frac {{\left (2 \, a b d^{2} f - a^{2} d^{2} g - {\left (2 \, c d f - c^{2} g\right )} b^{2}\right )} {\left (\log \left (b x + a\right ) \log \left (\frac {b d x + a d}{b c - a d} + 1\right ) + {\rm Li}_2\left (-\frac {b d x + a d}{b c - a d}\right )\right )} B^{2}}{b^{2} d^{2}} + \frac {B^{2} b^{2} d^{2} g x^{2} \log \left (e\right )^{2} + 2 \, {\left (a b d^{2} g \log \left (e\right ) + {\left (d^{2} f \log \left (e\right )^{2} - c d g \log \left (e\right )\right )} b^{2}\right )} B^{2} x + {\left (B^{2} b^{2} d^{2} g x^{2} + 2 \, B^{2} b^{2} d^{2} f x + {\left (2 \, a b d^{2} f - a^{2} d^{2} g\right )} B^{2}\right )} \log \left (b x + a\right )^{2} + {\left (B^{2} b^{2} d^{2} g x^{2} + 2 \, B^{2} b^{2} d^{2} f x + {\left (2 \, c d f - c^{2} g\right )} B^{2} b^{2}\right )} \log \left (d x + c\right )^{2} + 2 \, {\left (B^{2} b^{2} d^{2} g x^{2} \log \left (e\right ) + {\left (a b d^{2} g + {\left (2 \, d^{2} f \log \left (e\right ) - c d g\right )} b^{2}\right )} B^{2} x - {\left ({\left (g \log \left (e\right ) - g\right )} a^{2} d^{2} - {\left (2 \, d^{2} f \log \left (e\right ) - c d g\right )} a b\right )} B^{2}\right )} \log \left (b x + a\right ) - 2 \, {\left (B^{2} b^{2} d^{2} g x^{2} \log \left (e\right ) + {\left (a b d^{2} g + {\left (2 \, d^{2} f \log \left (e\right ) - c d g\right )} b^{2}\right )} B^{2} x + {\left (B^{2} b^{2} d^{2} g x^{2} + 2 \, B^{2} b^{2} d^{2} f x + {\left (2 \, a b d^{2} f - a^{2} d^{2} g\right )} B^{2}\right )} \log \left (b x + a\right )\right )} \log \left (d x + c\right )}{2 \, b^{2} d^{2}} \]
[In]
[Out]
\[ \int (f+g x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2 \, dx=\int { {\left (g x + f\right )} {\left (B \log \left (\frac {{\left (b x + a\right )} e}{d x + c}\right ) + A\right )}^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int (f+g x) \left (A+B \log \left (\frac {e (a+b x)}{c+d x}\right )\right )^2 \, dx=\int \left (f+g\,x\right )\,{\left (A+B\,\ln \left (\frac {e\,\left (a+b\,x\right )}{c+d\,x}\right )\right )}^2 \,d x \]
[In]
[Out]